package com.etc.cloud.service;

import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;

import javax.annotation.Resource;


/**
 * @Author kalista
 * @Description
 * @Date 2020/8/25  16:28
 **/
@EnableBinding(Source.class)
public class MessageProviderImpl implements IMessageProvider {

    @Resource
    private MessageChannel output;

    @Override
    public void send(String message) {
        Message<String> message1 = MessageBuilder.withPayload(message).build();
        output.send(message1);
    }



}
